import request from '@/utils/request'


export function getPhoneCode(data) {
  return request({
    url: "/common/sms/getPhoneCode",
    method: "get",
    params: data
  });
}
export function supplierRegApply(data) {
  return request({
    url: "/purchaseSupplier/apply",
    method: "post",
    data
  });
}
export function supplierPageFind(data) {
  return request({
    url: "/purchaseSupplier/find",
    method: "post",
    data
  });
}
//全部分类
export function getSupplierCategoryTree(data) {
  return request({
    url: "/supplierCategory/getSupplierCategoryTree",
    method: "get",
    params: data
  });
}
//根据供应商获取分类
export function getSupplierCategory(data) {
  return request({
    url: "/supplierCategory/getSupplierCategory",
    method: "get",
    params: data
  });
}
export function supplierCategorySave(data) {
  return request({
    url: "/supplierCategory/save",
    method: "post",
    data
  });
}
export function supplierCategoryDel(data) {
  return request({
    url: `/supplierCategory/del/${data.id}`,
    method: "post",
    data
  });
}

export function supplierSignDel(data) {
  return request({
    url: `/purchaseSupplier/del/${data.id}`,
    method: "post",
    data
  });
}
//删除供应商
export function supplierDelBatch(ids) {
  return request({
    url: `/purchaseSupplier/delBatch?ids=${ids}`,
    method: "get"
  });
}
//删除种类
export function delStoreApplyBatch(ids) {
  return request({
    url: `/purchaseSupplier/delStoreApplyBatch?ids=${ids}`,
    method: "get"
  });
}
//入库申请
export function supplierStoreApply(data) {
  return request({
    url: `/purchaseSupplier/storeApply`,
    method: "post",
    data
  });
}
//入库修改
export function supplierStoreUpdate(data) {
  return request({
    url: `/purchaseSupplier/storeUpdate`,
    method: "post",
    data
  });
}

//注册审核
export function supplierRegCheck(data) {
  return request({
    url: "/purchaseSupplier/check",
    method: "post",
    data
  });
}
//入库审核
export function supplierStoreCheck(data) {
  return request({
    url: "/purchaseSupplier/storeCheck",
    method: "post",
    data
  });
}
//入库审核列表
export function getSupplierStorePage(data) {
  return request({
    url: "/purchaseSupplier/findStoreList",
    method: "post",
    data
  });
}
//入库资料
export function getSupplierStoreInfo(data) {
  return request({
    url: "/purchaseSupplier/getApplyInfoById",
    method: "get",
    params: data
  });
}
//移入暂停
export function supplierPause(data) {
  return request({
    url: `/purchaseSupplier/pause`,
    method: "post",
    data
  });
}
//恢复暂停
export function supplierRestorePause(data) {
  return request({
    url: `/purchaseSupplier/pauseToOk`,
    method: "post",
    data
  });
}
//移入黑名单
export function supplierMoveBlacklist(data) {
  return request({
    url: `/purchaseSupplier/blacklist/into/${data.id}`,
    method: "post",
    params: data
  });
}
//恢复黑名单
export function supplierOutBlacklist(data) {
  return request({
    url: `/purchaseSupplier/blacklist/out/${data.id}`,
    method: "post",
    data
  });
}
//供应商详情
export function supplierDetail(data) {
  return request({
    url: `/purchaseSupplier/getById`,
    method: "get",
    params: data
  });
}

//通知列表
export function getNoticePage(data) {
  return request({
    url: `/bidNotification/list`,
    method: "post",
    data
  });
}
//发布公告
export function addNotice(data) {
  return request({
    url: `/bidNotification/add`,
    method: "post",
    data
  });
}
//修改公告
export function updateNotice(data) {
  return request({
    url: `/bidNotification/update`,
    method: "post",
    data
  });
}
//删除
export function delBatchNotice(data) {
  return request({
    url: `/bidNotification/delBatch`,
    method: "post",
    data
  });
}
//阅读
export function getNoticeReadPage(data) {
  return request({
    url: `/bidNotification/readRecordList`,
    method: "post",
    data
  });
}
//获取发给我的公告
export function getMyNoticeList(data) {
  return request({
    url: `/bidNotification/getMyList`,
    method: "post",
    data
  });
}
//更改阅读状态
export function setNoticeRecord(id) {
  return request({
    url: `/bidNotification/readNotificationRecord/${id}`,
    method: "get"
  });
}

//获取供应商评估
export function getSupplierEvaluationPage(data) {
  return request({
    url: `/supplierEvaluation/getSupplierEvaluation`,
    method: "get",
    params: data
  });
}
//评估列表
export function getEvaluationPage(data) {
  return request({
    url: `/supplierEvaluation/list`,
    method: "post",
    data
  });
}
//删除
export function getEvaluationDel(data) {
  return request({
    url: `/supplierEvaluation/del/${data.id}`,
    method: "get"
  });
}
//导出
export function getEvaluationExport(data) {
  return request({
    url: `/supplierEvaluation/export`,
    method: "post",
    data,
    //responseType: "arraybuffer",
    isBold: true,
    responseType: "blob"
  });
}
//保存
export function getEvaluationSave(data) {
  return request({
    url: `/supplierEvaluation/save`,
    method: "post",
    data
  });
}
//即将到期
export function getJiJiangDaoQi(data) {
  return request({
    url: `/smsRecord/getMyList`,
    method: "post",
    data
  });
}

//修改备注
export function updateStoreRemark(data) {
         return request({
           url: `/purchaseSupplier/updateStoreRemark`,
           method: "post",
           data
         });
       }




// 统计处理
export function countSupplierStoreBar(data) {
  return request({
    url: "/purchaseSupplier/findStoreList",
    method: "post",
    isTrue:true,
    data
  });
}




export function saveLicense(data) {
  return request({
    url: `/sysSet/saveLicense`,
    method: "post",
    data
  });
}

export function getLicenseInfo() {
  return request({
    url: `/sysSet/getLicenseInfo`,
    method: "get"
  });
}


export function getCaptcha() {
  return request({
    url: `/sysUser/captcha`,
    method: "get"
  });
}







export function getSupplierList(data) {
  return request({
    url: '/purchaseSupplier/find',
    method: 'post',
    data
  })
}
export function saveSupplierSave(data) {
  return request({
    url: '/purchaseSupplier/save',
    method: 'post',
    data
  })
}
export function delBatchSupplier(ids) {
    return request({
      url: `/purchaseSupplier/delBatch?ids=${ids}`,
      method: 'get',
    })
  }
export function delSupplier(id) {
  return request({
    url: `/purchaseSupplier/del/${id}`,
    method: 'post',
  })
}

//获取供应商针对物资的SKU
//物资ID,供应商ID
export function getSupplierSpecList(data) {
  return request({
    url: `/bid/getGoodsSku/${data.goodsId}/${data.purchaseId}`,
    method: 'post',
  })
}
//保存供应商SKU
export function saveSupplierSpec(data) {
  return request({
    url: `/bid/saveGoodsSku`,
    method: 'post',
    data
  })
}



/*  库外供应商  审核*/
export function supplierVerify(data) {
  return request({
    url: `/purchaseSupplier/check`,
    method: 'post',
    data
  })
}
export function saveSupplierQutside(data) {
  return request({
    url: '/purchaseSupplier/apply',
    method: 'post',
    data
  })
}